package de.backtomedieval.research;

import de.backtomedieval.R;
import de.backtomedieval.main.Game;
import de.backtomedieval.units.Archer;
import de.backtomedieval.units.Ballista;
import de.backtomedieval.units.Halberdier;
import de.backtomedieval.units.Hoplit;
import de.backtomedieval.units.LongSwordsman;
import de.backtomedieval.units.ShortSwordsman;
import de.backtomedieval.units.Spearman;

public class Chain_Mail extends AbstractResearch {

	private static int baseResearchPoints = 2000;
	
	
	public Chain_Mail() {
		this.setBaseResearchPoints(baseResearchPoints);
	}
	
	@Override
	public String getName() {
		return Game.getString(R.string.research_chain_mail);
	}
	
	protected void onLevelUp(Technology technology) {
		technology.setShortSwordsmanDefenseBonus(calculateNewTechnologyPoints(ShortSwordsman.getBaseDefense(), technology.getShortSwordsmanDefenseBonus(),getLevel(),30));
		technology.setLongSwordsmanDefenseBonus(calculateNewTechnologyPoints(LongSwordsman.getBaseDefense(), technology.getLongSwordsmanDefenseBonus(),getLevel(),30));
		technology.setArcherDefenseBonus(calculateNewTechnologyPoints(Archer.getBaseDefense(), technology.getArcherDefenseBonus(),getLevel(),30));
		technology.setHalberdierDefenseBonus(calculateNewTechnologyPoints(Halberdier.getBaseDefense(), technology.getHalberdierDefenseBonus(),getLevel(),30));
	
		
		
	}

	@Override
	public String getResearchInfo(int level) {
		String info="";
		info += Game.getString(R.string.unit_shortswordman) + ": " + Game.getString(R.string.defense) + " +" +calculateTechnologyPointsOfLevel(ShortSwordsman.getBaseDefense(), level,30)+"<br>";
		info += Game.getString(R.string.unit_longswordman) + ": " + Game.getString(R.string.defense) + " +" +calculateTechnologyPointsOfLevel(LongSwordsman.getBaseDefense(), level,30)+"<br>";
		info += Game.getString(R.string.unit_archer) + ": " + Game.getString(R.string.defense) + " +" +calculateTechnologyPointsOfLevel(Archer.getBaseDefense(), level,30)+"<br>";
		info += Game.getString(R.string.unit_halberdier) + ": " + Game.getString(R.string.defense) + " +" + +calculateTechnologyPointsOfLevel(Halberdier.getBaseDefense(), level,30);
		return info;
	}

}
